package vip.finance.makemoney.config;

/**
 * @author 杨滨
 * @date 2023年02月22日
 */

import cn.hutool.http.HttpRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import vip.finance.makemoney.common.Constant;

@Slf4j
@Component
@Order // 默认是最低优先级,值越小优先级越高
public class ApplicationRunnerConfig implements ApplicationRunner {
    @Override
    public void run(ApplicationArguments args) throws Exception {
        Constant.XQ_A_TOKEN = String.valueOf(HttpRequest.get("https://xueqiu.com").execute().getCookie("xq_a_token"));
        log.info("初始化雪球token成功");
    }
}
